package  com.openrange.dukes
{
	import flash.geom.Rectangle;
	import flash.net.SharedObject;
	
	import org.flixel.*;
	
	public class MenuState extends FlxState
	{
		[Embed(source = "../assets/TheReconLegendFont.ttf", fontFamily = "legend", embedAsCFF = "false")] protected var junk:String;
		[Embed(source = "../assets/pointer.png")] public var ImgCursor:Class;
		
		public var playButton:FlxButton;
		public var title:FlxText;
		
		
		override public function create():void
		{
			FlxG.bgColor = 0x00000000;
			
			title = new FlxText(FlxG.width /2 - 128, FlxG.height / 2 - 64, 256, "100 Dukes");
			title.setFormat("legend", 64, 0xffffff, "center");
			add(title);
			playButton = new FlxButton(FlxG.width / 2 - 50, FlxG.height / 2 + 50, "Play", onPlay);
			add(playButton);
			
			FlxG.mouse.show(ImgCursor, 2);
		}
		
		override public function destroy():void
		{
			super.destroy();
			playButton = null;
			title = null;
		}
		
		override public function update():void
		{
			super.update();
		}
		
		protected function onPlay():void
		{
			playButton.exists = false;
			FlxG.switchState(new PlayState());
		}
	}

}